home *** CD-ROM | disk | FTP | other *** search
/ My Neighborhood / My Neighborhood.iso / mac / MacFiles / Wagon.Dxr / 00891_script for draggable item.txt < prev    next >
Encoding:
Text File  |  1997-11-18  |  1.3 KB  |  42 lines

  1. on mouseDown
  2.   set mySprite = the clickOn
  3.   
  4.   -- save the starting position of the seed
  5.   set startH = the locH of sprite mySprite
  6.   set startV = the locV of sprite mySprite
  7.   
  8.   -- let the user drag the seed around, snapping into place, using the same cast member for the
  9.   -- drag item, and using sprite 11 as the constrain sprite
  10.   set snapped = dragItem(hVals, 357, FALSE, 11)
  11.   
  12.   -- when the mouse button is released, if the seed is not snapped into place, then...
  13.   --  if not snapped then
  14.   -- if the seed is within one of the two environments, and the spot on that side is still open
  15.   --    if (sprite mySprite within 18) then
  16.   --      set snapH = 568
  17.   --    else if (sprite mySprite within 19) then
  18.   --      set snapH = 422
  19.   --    else if (sprite mySprite within 20) then
  20.   --      set snapH = 276
  21.   --    else
  22.   --      set snapH = 0
  23.   --    end if
  24.   
  25.   --  if snapH = 0 then
  26.   -- snap the seed back to its starting position
  27.   puppetSound "Echo Gling.S"
  28.   set the locH of sprite mySprite = startH
  29.   set the locV of sprite mySprite = startV
  30.   updateStage
  31.   --  else
  32.   --    -- move the seed into the seed area on this side
  33.   --    snapTo mySprite, snapH, 357
  34.   --    set snapped = TRUE
  35.   --  end if
  36. end if
  37.  
  38. --  if snapped then
  39. --    go to frame "grow"
  40. --  end if
  41.  
  42. end mouseDown